<?php

class Slideimages extends AppModel {

    var $alias = 'Slideimages';
    var $name = 'Slideimages';
    var $useTable = 'slide_images';

    function getImages() {
        $conditions = array(
            'Slideimages.published' => 1,
        );
        $cacheName = 'slide_get_list';
        if (($data = Cache::read($cacheName, 'slide')) === false) {
            $data = $this->find('all', array(
                        'fields' => 'Slideimages.title,Slideimages.images',
                        'conditions' => $conditions,
                        'order' => array(
                            'Slideimages.id' => 'DESC'
                        )
                    ));
            Cache::write($cacheName, $data, 'slide');
        }
        return $data;
    }

    function paginateCount($conditions = null, $recursive = 0, $extra = array()) {
        $parameters = compact('conditions');
        $this->recursive = $recursive;
        $count = $this->find('count', array_merge($parameters, $extra));
        if (isset($extra['group'])) {
            $count = $this->getAffectedRows();
        }
        return $count;
    }

}

?>
